export function objectToNestedArray(obj) {
    let result = [];
    for (let key in obj) {
        if (obj.hasOwnProperty(key)) {
            let item = {
                name: key,
                val: obj[key].val,
                items: obj[key].items ? objectToNestedArray(obj[key].items) : []
            };
            result.push(item);
        }
    }
    return result;
}